#ifndef _GRAPHICS_ENGINE_H
#define _GRAPHICS_ENGINE_H

#include "Device.h"
#include "EffectContainer.h"
#include "Renderer.h"
#include "TextureContainer.h"
#include "Resolution.h"
#include "SetupInfo.h"


namespace Graphics
{
	class Engine
	{
	public:
		static bool Create(HINSTANCE aHInstance, const SetupInfo& aSetupInfo);
		static void Destroy();
		static Engine* GetInstance();
		static LPDIRECT3DDEVICE9 GetDevice();
		static HWND GetWindow();

		EffectContainer& GetEffectContainer();
		TextureContainer& GetTextureContainer();
		Resolution& GetResolution();

		void Update();
		void Render();

	private:
		Engine();
		~Engine();

	private:
		static Engine* ourInstance;
		Device myDevice;
		SetupInfo mySetupInfo;

		// Containers
		EffectContainer myEffectContainer;
		TextureContainer myTextureContainer;

		Resolution myResolution;

		Renderer myRenderer;
	};
}

#define GetRenderPos(vector) Graphics::Engine::GetInstance()->GetResolution().ConvertToRenderPos(vector)
#define GetRenderSize(vector) Graphics::Engine::GetInstance()->GetResolution().ConvertToRenderSize(vector)

#endif